<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateContactsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('contacts', function (Blueprint $table) {
            $table->increments('id');
            $table->string("name",50)->nullable(false);
            $table->string("gender",2)->default('男');
            $table->date("birth_date")->nullable(true);
            $table->string("mobile_phone",50)->nullable(true);
            $table->string("email",50)->unique()->nullable(true);
            $table->string("title",50)->nullable(true);
            $table->string("address")->nullable(true);
            $table->string("photo")->nullable(true);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('contacts');
    }
}
